package com.dnd.action.common;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Utils {
	private static long id = 0;

	public static synchronized long getId() {
		return ++id;
	}

	public static String getNowStr() {
		return getNowStr("yyyy-MM-dd HH:mm:ss");
	}

	public static String getNowStr(String dateFormat) {
		SimpleDateFormat format = new SimpleDateFormat(dateFormat);
		return format.format(new Date());
	}

	public static String getBetNums(int[] Nums) {
		String result = "";
		for (int i : Nums) {
			result += String.format("{0:D2}", i);
		}
		return result;
	}
}
